﻿Public Class Form1
    Dim ZeitBisFertig As Integer
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If fertiglabel.Text > 0 Then
            fertiglabel.Text = fertiglabel.Text - 1
        End If
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        ZeitBisFertig = TextBox1.Text
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        fertiglabel.Text = ZeitBisFertig
        Timer1.Enabled = True
        Timer2.Enabled = True
        Button1.Enabled = False
        Button2.Enabled = True
        TextBox1.Enabled = False
        Label3.Text = "Fertig in"
        fertiglabel.Visible = True
        Label4.Visible = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Enabled = False
        Timer2.Enabled = False
        Button1.Enabled = True
        TextBox1.Enabled = True
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        If fertiglabel.Text = 0 Then
            Timer1.Enabled = False
            Label3.Text = "PIZZA FERTIG!"
            Label4.Visible = False
            fertiglabel.Visible = False
            If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Then

            Else
                AxWindowsMediaPlayer1.Ctlcontrols.play()
            End If
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AxWindowsMediaPlayer1.Ctlcontrols.stop()
        Button2.Enabled = False
    End Sub
End Class
